package org.tony.web.spider;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Demo1
{

  /**
   * @param args
   */
  public static void main(String[] args)
  {
    String str = "更新时间：2012-07-05 21:37:32";
    String reg = "\\d{4}-\\d{2}-\\d{2}\\s\\d{2}:\\d{2}:\\d{2}";
    Pattern p = Pattern.compile(reg);
    Matcher m = p.matcher(str);
    while (m.find())
    {
      System.out.println(m.group());
    }

    String regex = "(\u7B2C)(.+)(\u7AE0)";
    Pattern p1 = Pattern.compile(regex);
    Matcher m1 = p1.matcher("第1496章 赞助费！（求鲜花！）");
    while (m1.find())
    {
      System.out.println(m1.groupCount());
      System.out.println(m1.group(2));
    }
    System.out.println("第1496章 赞助费！（求鲜花！）".replaceAll("！（.*$", ""));

    System.out.println(Integer.parseInt("070"));
  }
}
